package com.weixin.paleituo.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.weixin.paleituo.factory.AfterSaleFragmentFactory;

/**
 * Author yichao
 * Time  2018/4/1 10:44
 * Dest 售后
 */
public class AfterSalePagerAdapter extends FragmentPagerAdapter {
    private final String[] mStrArr;

    public AfterSalePagerAdapter(FragmentManager fm, String[]  strArr) {
        super(fm);
        mStrArr = strArr;
    }
    @Override
    public Fragment getItem(int position) {
        return  AfterSaleFragmentFactory.getFragment(position);
    }
    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mStrArr[position%mStrArr.length];
    }

    @Override
    public int getCount() {
        return mStrArr.length;
    }
}
